#!/usr/bin/env bash

deviceId=$1

if [ $# != 1 ]; then
    echo "sh apk-install-time.sh deviceId"
fi

currentDir=$(cd "$(dirname "$0")"; pwd)
curl http://m.com/Android/phone/Meilishuo.apk -o $currentDir/meilishuo.apk

start=`date '+%s'`
/Users/apple/work/android-sdk-macosx/platform-tools/adb -s ${deviceId} install -r $currentDir/meilishuo.apk >> ${currentDir}/time.txt
end=`date '+%s'`
echo $(expr "$end" - "$start") > ${currentDir}/install-time.txt
